<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="tutorial.css">
<TITLE>
Exercises
</TITLE>
</HEAD>
<BODY >
<A HREF="tutorial077.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="tutorial070.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc149">10.8</A>&nbsp;&nbsp;Exercises</H2>
<OL CLASS="enumerate" type=1><LI CLASS="li-enumerate"><BR>
<BR>
Consider the knapsack problem in section&nbsp;<A HREF="tutorial077.html#weight-constraint">10.7</A>.
Suppose that the items each have an associated profit, namely 17, 38, 18, 10
and 5, respectively. Which items should be included to maximise profit?<BR>
<BR>
<LI CLASS="li-enumerate"><BR>
<BR>
Write a predicate which, given a list of sizes of items and a list of
capacities of buckets, returns a list of (ground) sets indicating which
items should go into each bucket. Obviously each item should go into
exactly one bucket.<BR>
<BR>
Try it out with 5 items of sizes 20, 34, 9, 12 and 19, into 3 buckets of
sizes 60, 20 and 20.</OL>
<A NAME="@default288"></A>
<HR>
<A HREF="tutorial077.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="tutorial070.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
</BODY>
</HTML>
